﻿using System;
using System.Linq;
using System.Web;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Morgma.Infographics.Models;
using Morgma.Infographics.Extensions;
using Orchard.Autoroute.Models;

namespace Morgma.Infographics.ViewModels {
    public class QRCodeViewModel {
        public QRCodeViewModel(AutoroutePart autoroutePart, GoogleInfographicsSettingsPart settings) {
            TargetUrl = autoroutePart.Path.ToAbsoluteUrl();
            ApiUrl = settings.GoogleInfographicsApiUrl;
            ImageHeight = settings.ImageHeight.ToString();
            ImageWidth = settings.ImageWidth.ToString();
            ErrorCorrection = settings.ErrorCorrectionLevel;
            Margin = settings.Margin.ToString();           
        }
        public string TargetUrl { get; set; }
        public string ApiUrl { get; set; }
        public string ImageHeight { get; set; }
        public string ImageWidth { get; set; }
        public string ErrorCorrection { get; set; }
        public string Margin { get; set; }
    }
}